/**
 * 
 */
package cn.ad.server.web.servlet.v2.requesthandler;

import cn.ad.server.web.servlet.v2.parser.AdViewRtbRquestParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletResponse;

/**
 * @author Wu Chengjun
 */
public class AdviewBIDRequestHandler extends BIDRequestHandler{
	
	private static Logger LOGGER = LoggerFactory.getLogger(AdviewBIDRequestHandler.class);

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	public AdviewBIDRequestHandler() {
		setParser(new AdViewRtbRquestParser());
	}
	
	/* (non-Javadoc)
	 * @see cn.ad.server.web.servlet.v2.AdserverRequestServlet#handleExceptionResponse(java.lang.Exception, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public void handleExceptionResponse(Exception e, HttpServletResponse response) {
		if(!(e instanceof NullResponseException)){
			LOGGER.error("处理Adview Bid Request时出现异常，异常原因:{}", e.getMessage(), e);
		}
		response.setStatus(204);
		response.setContentLength(0);
	}
}
